package 练习题;

//1+2-3+4-5+6-7......+100

public class test01 {
    public static void main(String[] args) {
        int sum = 0;
        int oushuhe = 0;
        int jishuhe = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 2 == 0) {
                oushuhe += i;
            } else if  (i % 2 != 0){
                jishuhe +=i;
            }
        }
        sum=oushuhe-jishuhe+1+1;
        System.out.println(sum);
    }
}

